```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Feign调用参数传递详解 | 技术小馆</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            overflow: hidden;
        }
        .param-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        .mermaid-container {
            background: white;
            border-radius: 12px;
            padding: 2rem;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }
        .hover-underline-animation {
            display: inline-block;
            position: relative;
        }
        .hover-underline-animation::after {
            content: '';
            position: absolute;
            width: 100%;
            transform: scaleX(0);
            height: 2px;
            bottom: 0;
            left: 0;
            background-color: #6e8efb;
            transform-origin: bottom right;
            transition: transform 0.25s ease-out;
        }
        .hover-underline-animation:hover::after {
            transform: scaleX(1);
            transform-origin: bottom left;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <div class="flex justify-center mb-6">
                <span class="bg-white bg-opacity-20 px-4 py-1 rounded-full text-sm font-semibold flex items-center">
                    <i class="fas fa-code mr-2"></i> 微服务开发
                </span>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">Feign调用中的参数传递方式</h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto">
                深入理解Spring Cloud Feign的参数绑定机制与最佳实践
            </p>
            <div class="mt-10">
                <a href="#content" class="inline-block bg-white text-indigo-600 px-6 py-3 rounded-full font-medium hover:bg-opacity-90 transition-all duration-300 transform hover:-translate-y-1">
                    <i class="fas fa-book-open mr-2"></i> 开始阅读
                </a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 md:px-0 py-16" id="content">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="prose prose-lg max-w-none">
                <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-4">引言</h2>
                <p class="text-lg text-gray-700 leading-relaxed">
                    Feign是Spring Cloud中声明式的HTTP客户端，它简化了微服务间的HTTP调用。理解Feign参数传递的不同方式对于构建健壮的微服务系统至关重要。本文将详细介绍Feign调用中的参数传递方式以及<code>@FeignClient</code>注解的详细配置。
                </p>
            </div>
        </section>

        <!-- Parameter Passing Methods -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-4 flex items-center">
                <i class="fas fa-exchange-alt mr-3 text-indigo-500"></i> Feign参数传递的三种方式
            </h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <!-- Method 1 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl">
                    <div class="bg-indigo-100 p-6">
                        <div class="w-12 h-12 bg-indigo-500 rounded-full flex items-center justify-center text-white mb-4">
                            <i class="fas fa-link text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800 mb-2">路径传参</h3>
                        <p class="text-gray-600">直接将参数值嵌入到URL路径中</p>
                    </div>
                    <div class="p-6">
                        <div class="code-block p-4 rounded-lg mb-4">
                            <code class="text-sm">info/10</code>
                        </div>
                        <p class="text-gray-700">
                            使用<code>@PathVariable</code>注解绑定路径中的参数值
                        </p>
                    </div>
                </div>
                
                <!-- Method 2 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl">
                    <div class="bg-blue-100 p-6">
                        <div class="w-12 h-12 bg-blue-500 rounded-full flex items-center justify-center text-white mb-4">
                            <i class="fas fa-question-circle text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800 mb-2">查询参数</h3>
                        <p class="text-gray-600">通过URL问号后附加参数传递</p>
                    </div>
                    <div class="p-6">
                        <div class="code-block p-4 rounded-lg mb-4">
                            <code class="text-sm">?id=10</code>
                        </div>
                        <p class="text-gray-700">
                            使用<code>@RequestParam</code>注解绑定查询参数
                        </p>
                    </div>
                </div>
                
                <!-- Method 3 -->
                <div class="bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-xl">
                    <div class="bg-purple-100 p-6">
                        <div class="w-12 h-12 bg-purple-500 rounded-full flex items-center justify-center text-white mb-4">
                            <i class="fas fa-object-group text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800 mb-2">对象传参</h3>
                        <p class="text-gray-600">传递复杂对象作为参数</p>
                    </div>
                    <div class="p-6">
                        <div class="code-block p-4 rounded-lg mb-4">
                            <code class="text-sm">addUser(user)</code>
                        </div>
                        <p class="text-gray-700">
                            对象会自动序列化为JSON字符串传递，使用<code>@RequestBody</code>注解
                        </p>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 bg-yellow-50 border-l-4 border-yellow-400 p-4 rounded-r-lg">
                <div class="flex">
                    <div class="flex-shrink-0 text-yellow-500">
                        <i class="fas fa-exclamation-circle"></i>
                    </div>
                    <div class="ml-3">
                        <p class="text-sm text-yellow-700">
                            <strong>重要提示：</strong>在Feign接口上进行参数传递时，必须使用注解（如<code>@RequestParam</code>、<code>@PathVariable</code>等）明确绑定形参。
                        </p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Code Example -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-4 flex items-center">
                <i class="fas fa-laptop-code mr-3 text-indigo-500"></i> Feign接口示例
            </h2>
            
            <div class="code-block p-6 rounded-lg mb-8">
                <pre><code class="language-java">@FeignClient(
        value = "12-sentinel-feign-2", // 对应的服务名称
        fallback = SentinelFeign2Impl.class // 对应的降级对象
//        ,primary = true //   表示该对象是主，主的优先级较高
//        ,path = "/provider" // namesapce
//        ,url = "http://localhost:8080/" // 直连,一般用在测试
)
@Primary
public interface SentinelFeign2 {
    @PostMapping("/hello")
    public String hello(@RequestParam("age") Integer age);
}</code></pre>
            </div>
        </section>

        <!-- @FeignClient Parameters -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-4 flex items-center">
                <i class="fas fa-cog mr-3 text-indigo-500"></i> @FeignClient注解参数详解
            </h2>
            
            <div class="grid md:grid-cols-2 gap-6">
                <!-- Parameter Cards -->
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-font text-indigo-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">name/value 参数</h3>
                            <p class="text-gray-600 text-sm">指定Feign客户端的名称，用于标识服务名称</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(name = "service-name")</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-blue-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-link text-blue-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">url 参数</h3>
                            <p class="text-gray-600 text-sm">指定服务的URL地址，用于直接指定服务的物理位置</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(url = "http://localhost:8080")</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-purple-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-sliders-h text-purple-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">configuration 参数</h3>
                            <p class="text-gray-600 text-sm">指定自定义的Feign配置类，用于配置Feign客户端的行为</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(configuration = CustomFeignConfiguration.class)</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-pink-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-exclamation-triangle text-pink-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">decode404 参数</h3>
                            <p class="text-gray-600 text-sm">指定是否将404错误视为正常响应</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(decode404 = true)</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-green-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-shield-alt text-green-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">fallback 参数</h3>
                            <p class="text-gray-600 text-sm">指定服务降级处理类，当服务调用失败时执行降级逻辑</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(fallback = MyFallback.class)</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-red-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-industry text-red-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">fallbackFactory 参数</h3>
                            <p class="text-gray-600 text-sm">指定服务降级工厂类，用于创建服务降级处理类的实例</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(fallbackFactory = MyFallbackFactory.class)</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-yellow-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-road text-yellow-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">path 参数</h3>
                            <p class="text-gray-600 text-sm">指定服务的基础路径，用于构建请求的URL</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(path = "/api")</code>
                    </div>
                </div>
                
                <div class="param-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-teal-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-star text-teal-500"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold text-gray-800 mb-1">primary 参数</h3>
                            <p class="text-gray-600 text-sm">指定Feign客户端是否作为主要的Bean，解决依赖注入冲突</p>
                        </div>
                    </div>
                    <div class="code-block p-3 rounded">
                        <code class="text-sm">@FeignClient(primary = true)</code>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-4 flex items-center">
                <i class="fas fa-project-diagram mr-3 text-indigo-500"></i> Feign调用参数传递流程
            </h2>
            
            <div class="mermaid-container">
                <div class="mermaid">
                    graph TD
                        A[Feign客户端] -->|1. 路径参数| B[info/10]
                        A -->|2. 查询参数| C[?id=10]
                        A -->|3. 对象参数| D[JSON序列化]
                        B --> E[服务提供方]
                        C --> E
                        D --> E
                </div>
            </div>
        </section>

        <!-- Full Annotation Definition -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-4 flex items-center">
                <i class="fas fa-file-code mr-3 text-indigo-500"></i> @FeignClient注解完整定义
            </h2>
            
            <div class="code-block p-6 rounded-lg">
                <pre><code class="language-java">@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface FeignClient {
    @AliasFor("name")
    String value() default "";

    /** @deprecated */
    @Deprecated
    String serviceId() default "";

    String contextId() default "";

    @AliasFor("value")
    String name() default "";

    String qualifier() default "";

    String url() default "";

    boolean decode404() default false;

    Class&lt;?&gt;[] configuration() default {};

    Class&lt;?&gt; fallback() default void.class;

    Class&lt;?&gt; fallbackFactory() default void.class;

    String path() default "";

    boolean primary() default true;
}</code></pre>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto max-w-5xl px-4 md:px-0">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2 hover-underline-animation">
                        <a href="http://www.yuque.com/jtostring">技术小馆</a>
                    </h3>
                    <p class="text-sm">分享技术，传递知识</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition-colors duration-300">
                        <i class="fas fa-external-link-alt mr-1"></i> 访问语雀主页
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-sm">
                <p>© 2023 技术小馆. 版权所有.</p>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```